<template>
  <div class="layout_container">
    <div class="layout_slider" :class="{ fold: !!LayOutSettingStore.fold }">
      <logo></logo>
      <el-scrollbar class="scroll_bar">
        <el-menu
            text-color="#ccc"
            :collapse="!!LayOutSettingStore.fold"
            background-color="#001529"
        >
          <Menu :menuList="userStore.menuRoutes"></Menu>
        </el-menu>
      </el-scrollbar>
    </div>
    <div class="layout_tabbar" :class="{ fold: !!LayOutSettingStore.fold }">
      <Tabbar></Tabbar>
    </div>
    <div class="layout_main" :class="{ fold: !!LayOutSettingStore.fold }">
      <Main></Main>
    </div>
  </div>
</template>

<script setup lang="ts">
import Logo from '@/layout_manage/logo/index.vue'
import Menu from '@/layout_manage/menu/index.vue'
import Main from '@/layout_manage/main/index.vue'
import useUserStore from '@/store/modules/user'
import Tabbar from '@/layout_manage/tabbar/index.vue'
import useLayOutSettingStore from '@/store/modules/setting'
import {onMounted} from "vue";
//移除动画人物
onMounted(() => {
  setTimeout(() => {
    document.querySelector('#live2d-widget').remove();
  }, 1500)
})
let LayOutSettingStore = useLayOutSettingStore()
let userStore = useUserStore()
</script>

<style scoped lang="scss">
.layout_container {
  width: 100%;
  height: 100vh;

  //background-color: red;

  .layout_slider {
    width: 260px;
    height: 100vh;
    color: white;
    background-color: #001529;
    transition: all 0.3s;

    &.fold {
      width: 58px;
    }

    .scroll_bar {
      width: 100%;
      height: calc(100vh - 70px);

      .el-menu {
        border-right: none;
      }
    }
  }

  .layout_tabbar {
    position: fixed;

    //background-color: #ccc;
    top: 0;
    left: 260px;
    width: calc(100% - 260px);
    height: 50px;
    transition: all 0.3s;

    &.fold {
      left: 58px;
      width: calc(100vw - 58px);
    }
  }

  .layout_main {
    position: absolute;
    top: 58px;
    left: 260px;
    width: calc(100% - 260px);
    height: calc(100vh - 50px);

    background-color: #f1f3f6;
    padding: 20px;
    overflow: auto;
    transition: all 0.3s;

    &.fold {
      left: 58px;
      width: calc(100vw - 58px);
    }
  }
}
</style>
